First, I call population data for Alameda County, specifiying I’m interested in data on its Black population—first for 2020 and then for 2010.
In order to identify the overlap between 2010 and 2020 blocks, I then reduce the polygons to their centroids, as described in the textbook. I’m interested in Oakland data, so I subset Alameda County data to pull out Oakland data.
Then I find the actual overlap of the 2020 and 2010 blocks in Oakland, and remove the bits that don’t overlap.
Using the 2010 gemotry now, I transfer over the 2020 population data, specify the projection, and then find the difference in population between 2010 and 2020 divided by area to find change in population per acre.
And finally, I map the changes in the Black population density between 2010 and 2020.